{% extends "base.html" %}

{% load url from future %}

{% block extra_js %}
<script>$(showForm);</script>
{% endblock %}

{% block main %}
{% for room in rooms %}
<div class="room">
    <h1><a href="{{ room.get_absolute_url }}">{{ room }}</a></h1>
    <ul>
        {% for user in room.users.all %}
        <li>{{ user }}</li>
        {% endfor %}
    </ul>
</div>
{% empty %}
<p>There are currently no rooms! Add one below.</p>
{% endfor %}
<br clear="all">
{% endblock %}

{% block form %}
<form method="post" action="{% url "create" %}">
    <input type="text" id="name" name="name">
    <input type="submit" id="submit" value="Add Room">
    {% csrf_token %}
</form>
{% endblock %}
